package com.lzs.system.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lzs.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author 刘中帅
 * @since 2020-11-24
 */
@Repository
public interface RoleMapper extends BaseMapper<Role> {
    // 根据角色Id 查询所具有的权限ID
    List<Long> selectMenuByRoleId(Long roleId);
    int deleteMenuByRoleId(Long roleId);
    int insertMenuByRoleId(@Param("menus") List<Long> menus, @Param("roleId") Long roleId);
    List<String> selectRoleByUserId(Long userId);
    IPage<Role> selectRolePage(Page<Role> page, @Param("roles") Role role);
    Role  findByRoleId(Long roleId);
}
